﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WebEntities.Models.WebInfo
{
    public class AdvItem
    {
        public int AdvID { get; set; }
        public string AdvTitle { get; set; }
        public string AdvContent { get; set; }
        public string AdvType { get; set; }
        public int? AppearRate { get; set; }
        public int? SuiteID { get; set; }
        public string SuiteName { get; set; }
        public DateTime CreateTime { get; set; }
        public string Creator { get; set; }
        public DateTime? UpdateTime { get; set; }
        public string Modifier { get; set; }
        public string PicUrl { get; set; }
        public string PicLink { get; set; }
        public string AdvWidth { get; set; }
        public string AdvHeight { get; set; }
        public DateTime? BTime { get; set; }
        public DateTime? ETime { get; set; }

        public static AdvItem AsAdvItem(WI_AdvItem wiaItem, string suiteName)
        {
            AdvItem aitem = new AdvItem
            {
                AdvID = wiaItem.AdvID,
                AdvTitle = wiaItem.AdvTitle,
                AdvContent = wiaItem.AdvContent,
                AdvType = wiaItem.AdvType,
                AppearRate = wiaItem.AppearRate,
                SuiteID = wiaItem.SuiteID,
                SuiteName = suiteName,
                CreateTime = wiaItem.CreateTime,
                Creator = wiaItem.Creator,
                UpdateTime = wiaItem.UpdateTime,
                Modifier = wiaItem.Modifier,
                PicUrl = wiaItem.PicUrl,
                PicLink = wiaItem.PicLink,
                AdvWidth = wiaItem.AdvWidth,
                AdvHeight = wiaItem.AdvHeight,
                BTime = wiaItem.BTime,
                ETime = wiaItem.ETime
            };
            return aitem;
        }
    }
}
